#include <stdio.h>
#include "algorithm.h"
#define N 100010
int n,v[N];
int main(void){
    int i;
    freopen("sort.in","r",stdin);
    freopen("sort.out","w",stdout);
    scanf("%d",&n);
    for (i=1;i<=n;++i)
        scanf("%d",&v[i]);
    sort(v,1,n,2*n);
    for (i=1;i<=n;++i)
        printf("%d ",v[i]);
    if (is_sorted(v,1,n,2))
       printf("true");
    else
        printf("false");
    return 0;
}
